<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="con" style="border: 2px solid red;width: 400px;height: 300px;padding: 10px;">
        <img src="animal1.png" style="width: 100%;"/>
    </div>
</body>
<script>
    var con = document.getElementById("con");
    con.onmouseover = function(){
        this.style.border = "2px solid blue";
    }
    //鼠标摁下时
    con.onmousedown = function(){
        this.style.backgroundColor = "pink";
    }
    //鼠标松开时
    con.onmouseup = function(){
        this.style.backgroundColor = "white";
    }
    con.onclick = function(){
        console.log(this.style.height,this.style.width);
    }

    
</script>
</html>